package handler

import (
	"context"
	"fmt"
	"github.com/micro/go-micro/client"
	pb "srv1/proto/srv1"
)

type NewHandler struct {
	Client client.Client
}

var Address string

func Handler(SrvClient client.Client) pb.Srv1Handler {
	return &NewHandler{Client: SrvClient}
}

func (h *NewHandler) SubsSimu(ctx context.Context, event *pb.Request) error {
	//pub:=micro.NewPublisher("simu",h.Client)
	//if err:=pub.Publish(ctx,event);err!=nil{
	//	return err
	//}
	fmt.Println("收到信息", event.Data)

	return nil
}
